package com.itheima.String;

import java.util.Scanner;

public class DM04 {
    public static void main(String[] args) {
        String username = "admin";
        String passsword = "123456";
        Scanner sc  =new Scanner(System.in);
        for(int i =1;i<=3;i++){
            System.out.println("亲输入用户名");
            String scusername = sc.nextLine();
            System.out.println("请输入密码");
            String scpassword = sc.nextLine();

            if(username.equals(scusername)&&passsword.equals(scpassword)){
                System.out.println("登陆成功");
                break;
            }else{
                if(i ==3){
                    System.out.println("你的登录次数已达今日上线，请明天在来");
                }else{
                    System.out.println("登陆失败您还剩余"+(3-i)+"次机会");
                }
            }
        }
    }

}
